package de.szut.bomberman.gui.main;

import java.awt.Color;
import java.awt.Font;

import javax.swing.JLayeredPane;
import javax.swing.SwingConstants;

import de.szut.bomberman.main.Controller;
import de.szut.gui.language.TranslatableHoverLabel;
import de.szut.gui.language.TranslatableLabel;

/**
 * Default panel for all panels used 
 * @author Marc Huisinga
 *
 */
public abstract class DefaultPanel extends JLayeredPane {

	private static final long serialVersionUID = 717320814096415703L;

	private TranslatableLabel header;
	private TranslatableHoverLabel returnButton;
	
	public TranslatableLabel getHeader() {
		return header;
	}

	public void setHeader(TranslatableLabel header) {
		this.header = header;
	}

	public TranslatableHoverLabel getReturnButton() {
		return returnButton;
	}

	public void setReturnButton(TranslatableHoverLabel returnButton) {
		this.returnButton = returnButton;
	}
	
	public DefaultPanel() {
		setLayout(null);
		setOpaque(true);
		setBackground(Color.DARK_GRAY);
		
		header = new TranslatableLabel();
		header.setFont(new Font("Yanone Kaffeesatz", Font.BOLD, 50));
		header.setHorizontalAlignment(SwingConstants.CENTER);
		header.setBounds(10, 10, Controller.getInstance().getGuiController().getMainFrame().getWidth()-10, 50);
		header.setForeground(Color.RED);
		// TODO: Add some icon?
		add(header);
		
		returnButton = new TranslatableHoverLabel();
		returnButton.setBounds(Controller.getInstance().getGuiController().getMainFrame().getWidth()-100, Controller.getInstance().getGuiController().getMainFrame().getHeight()-50, 90, 20);
		returnButton.setFont(new Font("Tahoma", Font.PLAIN, 14));
		add(returnButton);
	}
}
